#!/usr/bin/python3
# -*- coding:utf-8 -*-

"""
python控制台倒计时
"""
__author__ = "river.yang"
__date__ = "2022/11/26 20:20"
__version__ = "1.0.0"

from time import sleep
from datetime import datetime, timedelta
import time


def count_down(weeks=0, days=0, hours=0, minutes=0, seconds=0):
    remain_time = timedelta(weeks=weeks, days=days, hours=hours, minutes=minutes, seconds=seconds)
    while remain_time.total_seconds() > 0:
        time.sleep(1)
        remain_time -= timedelta(seconds=1)
        print("\r 倒计时：{}".format(remain_time), end="", flush=True)


def print_test():
    for i in range(20):
        print("#", end="", flush=True)
        sleep(0.1)


if __name__ == '__main__':
    print("当前版本： ", __version__)
    count_down(seconds=11)

